print('=' * 30, 'For循环第一种方法(左下角)', '=' * 30)
for i in range(1, 10):
    for j in range(1, i + 1):
        print('{0}*{1}={2:<4}'.format(i, j, i * j), end='')
    print('')

print('=' * 30, 'For循环第二种方法(左上角)', '=' * 30)
for i in range(9, 0, -1):
    for j in range(1, i + 1):
        print('{0}*{1}={2:<4}'.format(i, j, i * j), end='')
    print('')

print('=' * 30, 'For循环第三种方法(右下角)', '=' * 30)
for i in range(1, 10):
    for k in range(1, 10 - i):
        print("        ", end="")
    for j in range(i, 0, -1):
        print('{0}*{1}={2:<4}'.format(j, i, i * j), end='')
    print('')

print('=' * 30, 'For循环第四种方法(右上角)', '=' * 30)
for i in range(9, 0, -1):
    for k in range(1, 10 - i):
        print("        ", end="")
    for j in range(i, 0, -1):
        print('{0}*{1}={2:<4}'.format(j, i, i * j), end='')
    print('')
